#!/bin/bash
confDir=~/docker/mysql8/conf
dataDir=~/docker/mysql8/data
# mkdir 目录
mkdir -p $confDir
mkdir -p $dataDir

# cp conf
cp my.cnf $confDir

# run
docker run -id -p 13306:3306 --name=mysql8 -v $confDir:/etc/mysql/conf.d -v $dataDir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=evn_L@cc12345 mysql

# 打开防火墙
sudo ufw allow 13306